home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / tools / ioport.com / MANUAL.I&C < prev    next >
Encoding:
Text File  |  1989-12-03  |  14.9 KB  |  339 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.                                      I&C - The Manual
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. I&C and IOPORT are copyright 1989 by R. A. Gramann.  No portion of this
  36. document or its accompanying programs may be reproduced without the written
  37. permission of R. A. Gramann.
  38.                                      Table of Contents
  39.  
  40. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
  41.  
  42. Copyright and plea for money . . . . . . . . . . . . . . . . . . . . . . . . . 2
  43.  
  44. Advantages of Registration . . . . . . . . . . . . . . . . . . . . . . . . . . 2
  45.  
  46. Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
  47.  
  48. Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
  49.  
  50. I&C Operation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
  51.       To Exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
  52.       Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
  53.       Snap (Breakpoint). . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
  54.  
  55. IOPORT Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
  56.  
  57. Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
  58.  
  59.  
  60. Introduction
  61.  
  62. I&C (short for Inspect and Change) is a Terminate-and-Stay-Resident (TSR)
  63. debugger.  It is a TSR, and unlike DEBUG and CodeView, it can be used to
  64. debug TSR programs as they operate.  Operating off of a hot key, it provides
  65. the following capabilities:
  66.  
  67.       1.  Memory inspection.
  68.       2.  Memory modification.
  69.       3.  Instruction breakpoint (snap) with data collection.
  70.  
  71. IOPORT, included with this package allows port input and output off of a hot
  72. key.
  73.  
  74. Unlike the standard DEBUG, this package allows you to interrupt processing
  75. at any time and to put a breakpoint in resident code.  While it is crude (it
  76. requires the use of an assembly level listing), it is simple to operate and
  77. can be used together with higher level debuggers.
  78.  
  79.  
  80. Copyright and plea for money
  81.  
  82. I&C and IOPORT are copyright 1989 by R. A. Gramann.  If you find these
  83. programs useful, please register them by sending $22.00 to:
  84.  
  85.       R. A. Gramann
  86.       122 Laurel Ave.
  87.       Fredericksburg, Va.  22401
  88.  
  89.  
  90. Advantages of Registration
  91.  
  92. These are the advantages of being a registered owner of this software:
  93.  
  94.       1.  You get the satisfaction of knowing that you have paid for what you
  95.       are using.  I get some return on my effort to create this program and
  96.       the pleasure of knowing that someone is using one of my programs.
  97.  
  98.       2.  I will send you a disk containing the latest version of I&C and
  99.       IOPORT as well as the source code for these programs.
  100.  
  101.       3.  The disk will also contain source code for the shell of a TSR hot-
  102.       key driven program.  Supply the guts of this program to do whatever you
  103.       want to do off of a hot key.
  104. Invocation
  105.  
  106. To start I&C:
  107.  
  108. Make sure that I&C.COM is in the current path.  Then type I&C at the DOS
  109. prompt as shown below.  I&C responds with the invocation message shown below
  110. identifying the hot key and stating the copyright.
  111.  
  112.  ┌──────────────────────────────────────────────────────────────┐ 
  113.  │C:\->i&c                                                      │
  114.  │                                                              │ 
  115.  │   I&C Installed.  Hit <Ctrl><Alt> L to invoke I&C routine.   │
  116.  │   I&C copyright 1989 by R.A. Gramann                         │
  117.  │C:\->                                                         │ 
  118.  └──────────────────────────────────────────────────────────────┘          
  119.    
  120. When invoked this way, operation of the I&C is inhibited while disk
  121. operations are taking place.  If for some reason you want to be able to
  122. interrupt disk operations and risk wrecking the FAT on the disk you may be
  123. writing to as well as any data you may be writing, invoke I&C with /D as an
  124. argument.  That is at the DOS prompt, type:  I&C /D.  If you use I&C in this
  125. mode, you risk destroying any disk you are writing to if you activate the hot
  126. key while you are writing to a disk.  
  127.                         
  128. To start IOPORT:
  129.  
  130. Make sure that IOPORT.COM is in the current path.  Type IOPORT at the DOS
  131. prompt.  IOPORT responds with the invocation message shown below identifying
  132. the hot key and stating the copyright.  As stated above for I&C, to allow hot
  133. key interruptions during disk accesses, start IOPORT with the /D argument: 
  134.  
  135.   IOPORT /D
  136. This permits you to destroy your disk as described above.
  137.  
  138.  ┌─────────────────────────────────────────────────────────────┐ 
  139.  │   C:\MASM->ioport                                           │
  140.  │                                                             │
  141.  │ IOPORT Installed.  Hit <Ctrl><Alt> I to invoke I/O routine. │
  142.  │ IOPORT copyright 1989 by R.A. Gramann                       │
  143.  │ C:\MASM->                                                   │ 
  144.  └─────────────────────────────────────────────────────────────┘  
  145. Operation
  146.  
  147. Note:
  148.  
  149. If you plan to use CodeView after you have loaded I&C or IOPORT, you may need
  150. to invoke CodeView with the /S (screen swapping) option in order to get the
  151. I&C or IOPORT display screen when the hot key is activated.
  152. I&C Operation
  153.  
  154. To access I&C at any time, hit <Ctrl><Alt> L together at any time.  Please
  155. note that if you have uninhibited the disk operation lockout, that hitting
  156. this key combination will a disk operation is occurring will probably destroy
  157. that operation in sometimes unpredictable ways.  (If the disk operation
  158. lockout is active, hitting these keys during a disk operation will have no
  159. effect.  You'll have to wait until the disk operation is over and try again.)
  160.  
  161.  
  162. To Exit
  163.  
  164. To exit I&C, hit <esc> at any time
  165.  
  166.  
  167. More on Operation
  168.  
  169.  
  170. When I&C is accessed, the screen shown below is displayed.  (The original
  171. screen is saved, to be restored when you exit I&C.)  Operation of I&C is
  172. possible in graphics modes since it writes to the screen through BIOS
  173. services, but the original graphics screens are not properly saved and will
  174. not be properly restored upon exit of I&C.
  175.  
  176. ┌─────────────────────────────────────────────────────────────────────────┐
  177. │  CS=0183  IP=1C95                                                       │
  178. │                                                                         │
  179. │  Segment  Length  Program                                               │
  180. │     09C6   00CA0  COMMAND.COM                                           │
  181. │     0A91   00030  unused                                                │
  182. │     0A95   00180  This block belongs to a program listed above.         │
  183. │     0AB4   007B0  C:\VIDEO.COM                                          │
  184. │     0B32   00630  c:\util\INSTALL.COM                                   │
  185. │     0B97   007F0  c:\util\DOSEDIT.COM                                   │
  186. │     0C1B   02B50  C:\MASM\I&C.COM                                       │
  187. │     0EC9   00060  unused                                                │
  188. │     0ED1   01420  C:\UTIL\CAPTURE.COM                                   │
  189. │  0000:0000 =   3F                                                       │
  190. │  Enter (B)yte, (W)ord, New (A)ddress, (N)ext, (P)revious, (C)hange, or  │
  191. │  (R)epeat, (S)nap, (D)einstall snap:                                    │
  192. │                                                                         │
  193. └─────────────────────────────────────────────────────────────────────────┘
  194.  
  195.                                         I&C Screen
  196.  
  197. The code segment and instruction pointer at time of interrupt are shown. 
  198. This can be helpful if you suspect you are in an infinite loop when you
  199. interrupt your program.  You can see where you are.
  200.  
  201. A map of memory follows showing the segment address, the length of each
  202. program in bytes, and the program name as shown in its environment block. 
  203. Where the program name is not found within the block, I&C assumes that it
  204. belongs to a previously loaded program and prints the message: "This block
  205. belongs to a program listed above."  As you use I&C this map will scroll
  206. upward off of the screen but it can be recalled at any time by exiting (hit
  207. <esc>) and reactivating I&C (hit <Ctrl> <Alt> L).
  208.  
  209. The address of the program block shown is the address of the Program Segment
  210. Prefix preceding the program.  The programs executable code begins 100h bytes
  211. past this address.  
  212.  
  213. After the memory map is the currently open inspect and change address.  The
  214. letter in parenthesis indicates the command letter for the listed action. 
  215. I&C is case insensitive for both command letter and hex number entries.  The
  216. Byte and Word command affect display format.  (Remember that with the 8086
  217. class of processors that the least significant bits are in the byte with the
  218. lowest address.  When you display in word format, I&C puts the most
  219. significant byte first so that a true 16-bit value is displayed.  That's why
  220. the byte order seems to reverse when you change formats.)  
  221.  
  222.  
  223. Commands
  224.  
  225. The New Address, Next, and Previous commands affect the current open address. 
  226. Next and Previous immediately move to the indicated word or byte, depending
  227. on the format.  New Address prompts for the entry of a new segment and
  228. address in hex format.  The new segment entry is optional.  If no segment is
  229. entered, the last used segment is the one that is active.  If a segment is
  230. entered, a colon must separate the segment from the relative address.  Free
  231. form entries are permitted for any numerical entry.  Up to 4 hex digits per
  232. segment, address, or content value are permitted.  Leading zeroes are not
  233. required to fill unused digit spaces.  Letter entries are honored in both
  234. upper and lower case.
  235.  
  236. The Change command permits a byte or word, depending on the format. entry
  237. into the currently open address.  It prompts for the new contents.  Either
  238. 2 or 4 digits will be accepted according to the format.
  239.  
  240. Repeat simply redisplays the currently open cell.
  241.  
  242.  
  243. Snap (Breakpoint)
  244.  
  245. The Snap and Deinstall Snap commands control the breakpoint.  Snap prompts
  246. for the segment and address of an instruction at which execution is to pause. 
  247. The rules for segment and address entry are the same as for the New Address
  248. command.  Please note that if the address you enter is not the first byte of
  249. an executable instruction, you will witness unpredictable results as program
  250. execution passes through the address entered.  A Snap in a ROM area will not
  251. operate since instructions in ROM cannot be replaced with a breakpoint instruction.  I&C Snap does not get along with breakpoints installed in other
  252. debuggers.  Please do not try to use I&C and DEBUG breakpoints together.  Use
  253. I&C breakpoints for your interrupt processors.  DEBUG won't work well with
  254. interrupt processor breakpoints.  If you're not debugging a TSR or a resident
  255. interrupt processor, you'll probably want to use DEBUG or Codeview or some
  256. other wraparound debugger with more features than I&C.
  257.  
  258. When you set the snap address to an executable instruction, the screen shown
  259. below appears when that instruction is executed.
  260.  
  261. ┌────────────────────────────────────────────────────────────────────────┐
  262. │                                                                        │
  263. │ AX=0224  BX=0007  CX=0001  DX=0322  SP=09B6  BP=000C  SI=0FA0  DI=13E9 │
  264. │ DS=0EDA  ES=0183  SS=0183  CS=0EDA  IP=023D  NV UP EI PL ZR NA PE NC   │
  265. │ 0EDA:023D                                                              │
  266. │ Enter <esc> to continue, anything else for I&C.                        │
  267. │                                                                        │
  268. └────────────────────────────────────────────────────────────────────────┘
  269.                                         Snap screen
  270.  
  271. where the flags are displayed as follows:
  272.  
  273. OV = Overflow set,            NV = Overflow clear
  274. DN = Direction down,                UP = Direction up
  275. EI = Interrupt enabled,             DI = Interrupt disabled
  276. NG = Sign negative,           PL = Sign plus
  277. ZR = Zero,                          NZ = No zero
  278. AC = Auxiliary carry,               NA = No Auxiliary carry
  279. PE = Parity Even.                   PO = Parity Odd
  280. CY = Carry,                         NC = No carry
  281.  
  282.  
  283. The contents of the registers, the flag states, and the current
  284. snap address are displayed.  <esc> continues program execution but
  285. does not reset the snap address.  Hitting any other key displays
  286. the regular I&C screen from which any address can be inspected or
  287. modified and from which another snap or the same snap address can
  288. be entered.  To repeat the same snap, or to set up another snap in
  289. the same segment, only the lower part of the address must be
  290. entered.  The segment address will not change unless you change it.
  291.  
  292.  
  293. IOPORT Operation
  294.  
  295. To access IOPORT at any time, hit <Ctrl><Alt> I together at any
  296. time.  Please note that if you have uninhibited the disk operation
  297. lockout, that hitting this key combination will a disk operation
  298. is occurring will probably destroy that operation in sometimes
  299. unpredictable ways.  (If the disk operation lockout is active, hitting these keys during a disk operation will have no effect. 
  300. You'll have to wait until the disk operation is over and try
  301. again.)
  302.  
  303. IOPORT will save your current screen and prompt you to enter W or
  304. B for word or byte Input/output (IO).  Note that Word IO has no
  305. meaning if you are not communicating with a 16 bit port.  It will
  306. then prompt you for a port number.  Enter a hex port number.  It
  307. will then ask if you want an input or an output operation.  If you
  308. reply with I for input, the requested port will be read and the
  309. result will be displayed.  If you reply O for output, it will
  310. prompt you for the byte or word to be output.  Once your entry is
  311. finished, an output operation will be performed on the specified
  312. port.  
  313.  
  314. You can hit <esc> at any time to exit IOPORT, or at the end of any
  315. operation, strike any key as prompted to go around again.  
  316.  
  317. Note:  If you are trying to output to the printer to test this,
  318. remember that printer output is a 3 step operation.  1) Output the
  319. character to print to the printer base port.  2)  Set the printer
  320. strobe high by outputting a hex D to the printer base port + 2. 
  321. 3)  Restore the printer strobe by outputting a hex C to the printer
  322. base port + 2.  (The printer strobe is bit 0 of the second port
  323. past the printer base port.)
  324.  
  325.  
  326. Summary
  327.  
  328. That's all there is to operating I&C and IOPORT.  In short, invoke
  329. the COM files and follow the prompts.  Good Luck.  I hope this
  330. program proves useful for you.  If it does, please remember to
  331. register.
  332.  
  333. If you are a registered user, please do not distribute the source
  334. code that you got in return for registration.  Also, please do not
  335. steal I&C or IOPORT and remarket it under any name.  If you want
  336. to use my code in a program for sale, we can negotiate a license
  337. very cheaply.  (The TSR shell is yours to use in any way that it
  338. helps you.  No license is required to use it in a marketable
  339. program.)